package org.lanqiao.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.lanqiao.bean.EduTeacherBean;
import org.lanqiao.bean.EduUserBean;
import org.lanqiao.myUtils.Myutils;
import org.lanqiao.service.FactoryService;

public class TeacherInfoModifySevelet extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		// 查询信息
		EduTeacherBean etb = (EduTeacherBean) Myutils.getNewInstance(EduTeacherBean.class);
		// 存名字
		etb.setTeachername(request.getParameter("userName"));
		// 存性別
		etb.setTeachersex(request.getParameter("userSex"));
		// 存年龄段
		etb.setTeacherage(Myutils.getInteger(request.getParameter("userAge")));

		etb.setTeacherage1(Myutils.getInteger(request.getParameter("userAge1")));

		// 存电话
		etb.setTeachertel(request.getParameter("userTel"));
		// 存地址
		etb.setTeacherdress(request.getParameter("userAddress"));
		// 调用查询方法
		List queryList = FactoryService.getUserInfoManageService().getTeaQueryList(etb);

		request.getSession().setAttribute("TeacherScope", queryList);

		request.getRequestDispatcher("logined/UserInfoManager/teacherInfoResultSuccess.jsp").forward(request,
				response);
	}
	

}
